"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const vue = require("vue");
const index = require("../popup/index.cjs");
require("../icons/index.cjs");
const antDesignVue = require("ant-design-vue");
const exclamationCircleIcon = require("../icons/exclamation-circle-icon.vue.cjs");
const _hoisted_1 = { class: "me-delete-tips-popup" };
const _hoisted_2 = { class: "me-delete-tips-inner" };
const _hoisted_3 = { class: "me-delete-tips-inner-box" };
const _hoisted_4 = {
  key: 0,
  class: "me-delete-tips-inner-box-content"
};
const _hoisted_5 = {
  key: 1,
  class: "me-delete-tips-inner-box-desc"
};
const _hoisted_6 = { class: "me-delete-tips-bottom" };
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...{
    name: "me-delete-tips"
  },
  __name: "delete-tips",
  props: {
    title: { default: "删除提示" },
    content: { default: "你确定删除该数据吗？" },
    desc: { default: "" },
    width: { default: "400px" },
    height: { default: "auto" },
    showIcon: { type: Boolean, default: true },
    okText: { default: "确定" },
    cancelText: { default: "取消" },
    showCancel: { type: Boolean, default: false },
    show: { type: Boolean, default: false },
    loading: { type: Boolean, default: false }
  },
  emits: ["cancel", "ok", "update:show"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emits = __emit;
    const visible = vue.ref(false);
    vue.watch(() => props.show, () => {
      vue.nextTick(() => {
        visible.value = props.show;
      });
    }, { immediate: true });
    const onCancel = () => {
      visible.value = false;
      emits("cancel");
      emits("update:show", false);
    };
    const onOk = () => {
      emits("ok");
      visible.value = false;
      emits("update:show", false);
    };
    const onClick = () => {
      visible.value = true;
    };
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createElementBlock("div", {
        onClick,
        class: "me-delete-tips"
      }, [
        vue.renderSlot(_ctx.$slots, "default"),
        vue.createVNode(vue.unref(index.Popup), {
          value: visible.value,
          "onUpdate:value": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
          mask: "",
          title: _ctx.title,
          width: _ctx.width,
          height: _ctx.height,
          onClose: onCancel
        }, {
          default: vue.withCtx(() => [
            vue.createElementVNode("div", _hoisted_1, [
              vue.createElementVNode("div", _hoisted_2, [
                _ctx.showIcon ? (vue.openBlock(), vue.createBlock(vue.unref(exclamationCircleIcon.default), {
                  key: 0,
                  class: "me-delete-tips-inner-icon"
                })) : vue.createCommentVNode("", true),
                vue.createElementVNode("div", _hoisted_3, [
                  _ctx.content ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, vue.toDisplayString(_ctx.content), 1)) : vue.createCommentVNode("", true),
                  _ctx.desc ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, vue.toDisplayString(_ctx.desc), 1)) : vue.createCommentVNode("", true)
                ])
              ]),
              vue.createElementVNode("div", _hoisted_6, [
                _ctx.showCancel ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Button), {
                  key: 0,
                  onClick: onCancel,
                  class: "me-delete-tips-bottom-btn"
                }, {
                  default: vue.withCtx(() => [
                    vue.createTextVNode(vue.toDisplayString(_ctx.cancelText), 1)
                  ]),
                  _: 1
                })) : vue.createCommentVNode("", true),
                vue.createVNode(vue.unref(antDesignVue.Button), {
                  loading: _ctx.loading,
                  onClick: onOk,
                  class: "me-delete-tips-bottom-btn",
                  type: "primary"
                }, {
                  default: vue.withCtx(() => [
                    vue.createTextVNode(vue.toDisplayString(_ctx.okText), 1)
                  ]),
                  _: 1
                }, 8, ["loading"])
              ])
            ])
          ]),
          _: 1
        }, 8, ["value", "title", "width", "height"])
      ]);
    };
  }
});
exports.default = _sfc_main;
//# sourceMappingURL=delete-tips.vue2.cjs.map
